package JD_LOCK;

public class Example_02 {
    void action() {
        Lock l = new ReentrantLock();
        l.lock();
        try {
            dosomething();
        } catch (Exception e) {
            // ...
        } finally {
            l.unlock();
        }
    }

    private void dosomething() throws Exception {
        // ...
    }
}
